package cn.sangyy.auth.listener;

import cn.sangyy.auth.service.IPermissionScanService;
import org.springframework.beans.factory.annotation.Autowired;

import javax.servlet.ServletContextEvent;
import javax.servlet.ServletContextListener;
import javax.servlet.annotation.WebListener;

/**
 * @author SangYY
 * @date: 2023/05/16/20:14
 */
@WebListener
public class InitListener implements ServletContextListener {

    @Autowired
    private IPermissionScanService permissionScanService;

    @Override
    public void contextInitialized(ServletContextEvent sce) {
        System.out.println("权限扫描开始。。。。。。。。。。。。。");
//        permissionScanService.scan();
        System.out.println("权限扫描结束。。。。。。。。。。。。。");
    }

    @Override
    public void contextDestroyed(ServletContextEvent sce) {
        System.out.println("容器销毁时执行。。。。。。。。。。。。。");
    }
}
